package com.repair.order.validator;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author chunyu
 * @since 2024/10/2,15:51
 * 如果在需要做其他校验
 *  1.创建校验器
 *  2.在这个类注入那个校验器
 *  3.在构造方法最后一个的setNext设置新添加的校验器
 */
@Configuration
public class OrderCreateValidatorConfig {

    @Autowired
    private ServiceTypeValidate serviceTypeValidate;

    @Autowired
    private WorkerValidate workerValidate;

    @Bean
    public OrderCreateValidator orderCreateValidator() {
        serviceTypeValidate.setNext(workerValidate);
        return serviceTypeValidate;
    }


}
